DEFINE=-D_NO_SSL
SRCS=	compat_unix.c string.c shttpd.c log.c auth.c md5.c cgi.c io_ssi.c \
		io_file.c io_socket.c io_ssl.c io_emb.c io_dir.c io_cgi.c
HDRS=		defs.h llist.h shttpd.h std_includes.h io.h md5.h ssl.h \
		compat_unix.h compat_rtems.h config.h
OBJS=		$(SRCS:%.c=%.o) 
TARGETS=	libshttpd.a
# 目标输出路径
TARGET_OUT_PUT := ../output

# 编译选项
#RELEASE := 0
#ifeq ($(RELEASE), 1)
#	CFLAGS += -O2
#else
#	CFLAGS += -O0
#endif

#CFLAGS=-g -Wall
LIBS= -ldl -pthread

.c.o:
	$(CC) -c $(CFLAGS)  $(DEFINE) $< -o $@ 

.PHONY : all
all: $(TARGETS)
	
$(TARGETS):$(OBJS)
	test -d $(TARGET_OUT_PUT) || mkdir -p $(TARGET_OUT_PUT)
	$(AR) -r  $(TARGET_OUT_PUT)/$(TARGETS) $(OBJS)  2>&1
	ranlib  $(TARGET_OUT_PUT)/$(TARGETS) 2>&1
	#$(AR) -r $(TARGET_OUT_PUT)/$@ $^ 
	#ranlib $(TARGET_OUT_PUT)/$(TARGETS)
	
#$(OBJS):$(SRCS)
#	$(CC) -c $(CFLAGS) $< -o $@

clean:
	rm -rf *.o *.core $(TARGET_OUT_PUT)/$(TARGETS)
